As a core of an operating system, a kernel is in charge of managing system processes, memories, device drivers, files and network systems, and determines the performance and stability of the system. A kernel vulnerability repairing coding method by replacing the kernel and restarting the system cannot satisfy the requirement of high reliability. Therefore, a vulnerability repairing coding technology supporting the instant upgrading of a to-be-repaired kernel function in the kernel running process is needed. The existing kernel vulnerability hot repairing coding technology repairs the kernel function in the running process of the kernel in the form of memory vulnerability repairing code without replacing the whole kernel, which facilitates enhancing the reliability of the system.
Due to the fragmentation of kernels in Linux and other operating systems, definitions of the same struct and realized codes of the same function by different kernels may be different, and different compiling options may result in difference of the kernels, which poses a great challenge to the Linux kernel hot patching solutions. Currently, the hot patching solutions in the art need to compile source codes of a target kernel and repair codes to generate patches. Meanwhile, the patches are limited to be applied to only this target kernel. When the patches need to be applied to other kernels, recompiling is needed to generate new patches. When there are more versions of the kernels need to be repaired, a large amount of resources need to be expended.